package com.ag.wzp.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ag.admin.dao.AdminTbUserDAO;
import com.ag.bean.TbDisposalAdvice;
import com.ag.bean.TbUser;
import com.ag.common.IBaseService;
import com.ag.common.IDUtil;
import com.ag.common.IIDService;
import com.ag.dao.TbDisposalAdviceDAO;
import common.Logger;

@Service("dispoalServiceImpl")
public class DisposalServiceImpl implements IBaseService<TbDisposalAdvice,String>{
	private static final Logger logger = Logger.getLogger(DisposalServiceImpl.class);
	@Resource(name = "iDServiceImpl")
	private IIDService idServiceImpl;
//	@Resource(name="TbNotifytodeptDAO")
//	private TbNotifytodeptDAO submitDAO;
	@Resource(name="TbDisposalAdviceDAO")
	private TbDisposalAdviceDAO disposalAdviceDAO;
	@Resource(name="adminTbUserDAO")
	private AdminTbUserDAO userDAO;
	@Override
	public boolean delete(String id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean delete(TbDisposalAdvice t) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public TbDisposalAdvice findById(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean save(TbDisposalAdvice t) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean update(TbDisposalAdvice t) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean save(TbUser user, String eId, String daContent) {
		TbDisposalAdvice da = new TbDisposalAdvice();
		da.setDaId(this.idServiceImpl.findTablePK(IDUtil.TB_DISPOSAL_ADVICE));
		logger.info("uid="+user.getUId());
		TbUser u = this.userDAO.findDeptById(user.getUId());
		//String sid = eId+u.getTbDept().getDId();
		//logger.info("sid="+sid);
		//da.setTbSubmit(this.submitDAO.findById(sid));
		//da.setTbUser(user);
		da.setDaContent(daContent);
		//da.setDaTime(new Date());
		da.setA(IDUtil.PRESERVE);
		this.disposalAdviceDAO.save(da);
		logger.info("disposaladivce");
		return false;
	}

	
}
